<?php
header("Content-type: text/html;charset=utf-8");
$id = $_GET["id"];
if(($id == "")or!is_numeric($id)){
     echo "<script>alert('参数错误');history.back();</script>";
     exit;
}
include_once "conn.php";
$sql="update imginfo set currentNum = currentNum + 1 where id = $id";
$result=mysqli_query($conn,$sql);
if(result){
    echo "<script>alert('投票成功！');location.href='index.php';</script>";
}
else{
    echo "<script>alert('投票失败！');history.back();</script>";
}